import unittest

from White import Triangle
from Black import CheckId


class MyTest(unittest.TestCase):
    # 编写测试用例，记得要以t开头，例：test
    def testEqual(self):
        # 调用内部的测试方法，如：assertEqual,assertNotEqual 等
        self.assertEqual(Triangle.triangle(3, 4, 5), "regular triangle!")
        self.assertEqual(Triangle.triangle(5, 5, 5), "equilateral triangle!")
        self.assertEqual(Triangle.triangle(5, 4, 5), "isosceles triangle!")

    def testNotEqual(self):
        self.assertEqual(Triangle.triangle("3", 4, 5), "not a triangle!")
        self.assertEqual(Triangle.triangle(3, 4, 8), "not a triangle!")

    def testId(self):
        # Black 传入身份证号，调用 exec 返回验证的结果
        # self.assertEqual(CheckId.Black('440102186005053231').exec(), 1)
        # self.assertEqual(CheckId.Black('440102226005053235').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200002293238').exec(), 1)
        # self.assertEqual(CheckId.Black('440102200109053234').exec(), 1)
        # self.assertEqual(CheckId.Black('440102200102083238').exec(), 1)
        # self.assertEqual(CheckId.Black('440102200002083230').exec(), 1)
        # self.assertEqual(CheckId.Black('440102200005083236').exec(), 1)
        # self.assertEqual(CheckId.Black('44010220010905320x').exec(), 0)
        # self.assertEqual(CheckId.Black('44010220010905320X').exec(), 1)
        #
        # self.assertEqual(CheckId.Black('4401022001953234').exec(), 0)
        #
        # self.assertEqual(CheckId.Black('440102200x09053234').exec(), 0)
        # self.assertEqual(CheckId.Black('44010220010208323x').exec(), 0)
        #
        # self.assertEqual(CheckId.Black('44010220010905320X+').exec(), 1)
        # self.assertEqual(CheckId.Black('440102190002293231').exec(), 0)
        # self.assertEqual(CheckId.Black('440102180002293232').exec(), 0)
        # self.assertEqual(CheckId.Black('440102180000003238').exec(), 0)
        #
        # self.assertEqual(CheckId.Black('440102x0010905320X').exec(), 0)
        # self.assertEqual(CheckId.Black('4401022x010905320X').exec(), 0)
        # self.assertEqual(CheckId.Black('44010220x10905320X').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200x0905320X').exec(), 0)
        # self.assertEqual(CheckId.Black('4401022001x905320X').exec(), 0)
        # self.assertEqual(CheckId.Black('44010220010x05320X').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200109x5320X').exec(), 0)
        # self.assertEqual(CheckId.Black('4401022001090x320X').exec(), 0)
        #
        # self.assertEqual(CheckId.Black('440102200109053200').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200109053201').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200109053202').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200109053203').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200109053204').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200109053205').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200109053206').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200109053207').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200109053208').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200109053209').exec(), 0)
        #
        # self.assertEqual(CheckId.Black('440102200000083237').exec(), 1)
        # self.assertEqual(CheckId.Black('44010220001508323x').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200102003234').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200102293238').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200002003233').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200002303231').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200101003232').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200101323237').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200004003236').exec(), 0)
        # self.assertEqual(CheckId.Black('440102200004313233').exec(), 0)
        # self.assertEqual(CheckId.Black('44010220000508323').exec(), 0)

        pass


# 运行测试
if __name__ == '__main__':
    unittest.main()
